<include file="Public:header" />
<form class="form-inline definewidth m20" action="{:U('Home/EquRepairRecords/index')}" method="get">    
    纪录编号：
    <input type="text" name="repair_record_no" id="repair_record_no"class="abc input-default" placeholder="" value="{$repair_record_no}">&nbsp;&nbsp; 
     设备编号：
    <input type="text" name="number" id="number"class="abc input-default" placeholder="" value="{$number}">&nbsp;&nbsp;  
    <button type="submit" class="btn btn-primary">查询</button>&nbsp;&nbsp; <button type="button" class="btn btn-success" id="addnew">新增维保纪录</button>
</form>
<table class="table table-bordered table-hover definewidth m10">
    <thead>
    <tr>
        <th></th>
        <th>维保纪录编号</th>
        <th>设备编号</th>
        <th>维保员工</th>
        <th>合同编号</th>
        <th>企业名称</th>
        <th>维修时间</th>
        <th>企业评价</th>
        <th>操作</th>
    </tr>
    </thead>
	     <foreach name="list" item="l_val" key="lk">
        <tr>
            <td>{$lk+1}</td>
            <td>{$l_val.repair_record_no}</td>
            <td>{$l_val.equnumber}({$l_val.equname})</td>
            <td>{$l_val.user_id}({$l_val.nickname|default=$l_val.name})</td>
            <td>{$l_val.contract_id}</td>
            <td>{$l_val.com_name}({$l_val.company_id})</td>
            <td>{$l_val.repair_time|date='Y-m-d',###}</td>
            <td>{$l_val.score|default="暂无评价"}</td>
            <td>
                <a href="{:U('Home/EquRepairRecords/view',array('equid'=>$l_val['equ_repair_records_id']))}" title="查看" ><icon class="icon-eye-open" ></icon></a>
                <a href="{:U('Home/EquRepairRecords/edit',array('equid'=>$l_val['equ_repair_records_id']))}" title="编辑" ><icon class="icon-edit" ></icon></a>
                <a href="javascript:delete_user({$l_val['equ_repair_records_id']})" title="删除"><icon class="icon-trash" ></icon></a>
            </td>
        </tr>
    </foreach>
</table>
<script>
    $(function () {

        $('#addnew').click(function(){

            window.location.href="{:U('Home/EquRepairRecords/add')}";
        });
    });

    function delete_user(id)
    {
        if(confirm("确定要删除吗？"))
        {
            $.get("{:U('Home/EquRepairRecords/delete',array('equid'=>$l_val['equ_repair_records_id']))}",function (xhr) {
                if(200 == xhr.status){
                    alert(xhr.msg);
                    window.location.href="{:U('Home/EquRepairRecords/Index')}";
                }else{
                    alert(xhr.msg);
                }
            });
        }
    }
</script>

<include file="Public:footer" />

